from Queue import Queue
MAX = 100

root_url = "http://www.anquanbao.com"

url_queue = Queue(MAX)
url_queue.put(root_url)


def get_new_url(current_url):
    pass


while True:
    if condition:
        break

    current_url = url_queue.get()

    new_urls = get_new_url(current_url)
    for next_url in new_urls:
        if next_url not in seen:
            seen.put(next_url)
            url_queue.put(next_url)